<?php
class Views_Helpers_ShowEnter extends Zend_View_Helper_Abstract{
        public $view;
        public function setView(Zend_View_Interface $view){
            $this->view = $view;
        }

	public function showEnter(){
            $auth = Zend_Auth::getInstance();
            if($auth->hasIdentity()){
                $str = $this->view->showUserPanel($auth->getIdentity()->id);
            } else if(preg_match('/.+register$/',$this->view->url()) || preg_match('/.+login$/',$this->view->url())){
                $str = '';
            }
            else {
                $str = $this->view->showEntranseForm();
            }
            return '<div class="enterblock">' . $str . '</div>';
	}
}